package com.edu.service.ordertab;

import com.edu.dao.OrderDao;
import com.edu.entity.Order;

import java.math.BigInteger;
import java.sql.SQLException;
import java.util.List;

/**
 * @author ZCN
 * @version 1.0
 * @date 2021/11/24 9:26
 */
public class OrderServiceImpl implements OrderService{
    private OrderDao orderDao = new OrderDao();
    @Override
    public void insert(Order order) throws SQLException {
        orderDao.insert(order);
    }

    @Override
    public BigInteger returnKeyAfterInsert(Order order) throws SQLException {
        return orderDao.returnKeyAfterInsert(order);
    }

    @Override
    public Order selectByid(BigInteger id) throws SQLException {
        return orderDao.selectByid(id);
    }

    @Override
    public void updateAfterPay(String ordersn) throws SQLException {
        orderDao.updateAfterPay(ordersn);
    }

    @Override
    public List<Order> selectAll() throws SQLException {
        return orderDao.selectAll();
    }

    @Override
    public void cancelOrder(Integer id) throws SQLException {
        orderDao.cancelOrder(id);
    }

    @Override
    public List<Order> findnotpayByUserid(Integer userid) throws Exception {
        return orderDao.findnotpayByUserid(userid);
    }

    @Override
    public List<Order> findnotserveByUserid(Integer userid) throws SQLException {
        return orderDao.findnotserveByUserid(userid);
    }

    @Override
    public List<Order> findsuccessByUserid(Integer userid) throws SQLException {
        return orderDao.findsuccessByUserid(userid);
    }

    @Override
    public List<Order> findcancelByUserid(Integer userid) throws SQLException {
        return orderDao.findcancelByUserid(userid);
    }

    @Override
    public void successorder(Integer id) throws SQLException {
         orderDao.successorder(id);
    }
}
